/*
 * @Description: 使用 qiankun 微前端框架配置项目
 * @Author: gino deng
 * @Date: 2024-12-14 16:36:55
 * @LastEditors: gino deng
 * @LastEditTime: 2024-12-14 21:08:24
 */
import { registerMicroApps, start, initGlobalState } from "qiankun";
import { loading } from "../store";

const state = {
  a: 1,
  b: 2
}
initGlobalState(state)
export const registerApp = (list) => {
  // 注册到微前端框架里
  registerMicroApps(list, {
    beforeLoad: [
      () => {
        loading.changeLoading(true)
        console.log('开始加载');
        
      }
    ],
    afterMount: [
      () => {
        loading.changeLoading(false)
        console.log('渲染完成');
        
      }
    ],
    afterUnmount: [
      () => {
        console.log('卸载完成');
        
      }
    ]
  })
  // 开启微前端框架
  start()
}